// Copyright (c) 2024，D-Robotics.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/***************************************************************************
 *                      COPYRIGHT NOTICE
 *             Copyright(C) 2024, D-Robotics Co., Ltd.
 *                     All rights reserved.
 ***************************************************************************/

/**
 * @file hb_camera_error.h
 *
 * @NO{S10E02C01}
 * @ASIL{B}
 */

#ifndef __HB_CAMERA_ERROR_H__
#define __HB_CAMERA_ERROR_H__

#ifdef __cplusplus
extern "C" {
#endif

#ifndef RET_OK
#define RET_OK 0
#endif
#ifndef RET_ERROR
#define RET_ERROR 1
#endif

// TODO: redefine camera error code
#define HB_CAM_PARSE_BOARD_CFG_FAIL (200)
#define HB_CAM_PARSE_MIPI_CFG_FAIL	(201)
#define HB_CAM_DLOPEN_LIBRARY_FAIL	(202)
#define HB_CAM_INIT_FAIL			(203)
#define HB_CAM_DEINIT_FAIL			(204)
#define HB_CAM_START_FAIL			(205)
#define HB_CAM_STOP_FAIL			(206)
#define HB_CAM_I2C_WRITE_FAIL		(207)
#define HB_CAM_I2C_WRITE_BYTE_FAIL	(208)
#define HB_CAM_I2C_WRITE_BLOCK_FAIL	(209)
#define HB_CAM_I2C_READ_BLOCK_FAIL		(210)
#define HB_CAM_DYNAMIC_SWITCH_FAIL		(211)
#define HB_CAM_DYNAMIC_SWITCH_FPS_FAIL	(212)
#define HB_CAM_SERDES_POWERON_FAIL		(213)
#define HB_CAM_SERDES_CONFIG_FAIL		(214)
#define HB_CAM_SERDES_STREAM_ON_FAIL	(215)
#define HB_CAM_SERDES_STREAM_OFF_FAIL	(216)
#define HB_CAM_SENSOR_POWERON_FAIL		(217)
#define HB_CAM_SENSOR_POWEROFF_FAIL		(218)
#define HB_CAM_START_PHYSICAL_FAIL		(219)
#define HB_CAM_SPI_WRITE_BLOCK_FAIL		(220)
#define HB_CAM_SPI_READ_BLOCK_FAIL		(221)
#define HB_CAM_INVALID_PARAM		(222)
#define HB_CAM_SET_EX_GAIN_FAIL		(223)
#define HB_CAM_SET_AWB_FAIL			(224)
#define HB_CAM_I2C_READ_FAIL		(225)
#define HB_CAM_I2C_READ_BYTE_FAIL	(226)
#define HB_CAM_RESET_FAIL			(227)
#define HB_CAM_OPS_NOT_SUPPORT		(228)
#define HB_CAM_ISP_POWERON_FAIL		(229)
#define HB_CAM_ISP_POWEROFF_FAIL	(230)
#define HB_CAM_ISP_RESET_FAIL		(231)
#define HB_CAM_ENABLE_CLK_FAIL		(232)
#define HB_CAM_DISABLE_CLK_FAIL		(233)
#define HB_CAM_SET_CLK_FAIL			(234)
#define HB_CAM_DYNAMIC_SWITCH_MODE_FAIL	(235)
#define HB_CAM_INVALID_OPERATION		(236)
#define HB_CAM_IPI_RESET_FAIL			(237)
#define HB_CAM_SERDES_LIB_OPEN_FAIL		(238)
#define HB_CAM_SERDES_LIB_OPS_FAIL		(239)
#define HB_CAM_SERDES_INFO_FAIL		(240)
#define HB_CAM_EMB_INFO_FAIL		(241)

#define HB_VIN_SENSOR_LIB_OPEN_FAIL			(1000)
#define HB_VIN_SENSOR_LIB_OPS_FAIL			(1001)
#define HB_VIN_SENSOR_LIB_INIT_FAIL			(1002)
#define HB_VIN_SENSOR_LIB_START_FAIL		(1003)
#define HB_VIN_SENSOR_LIB_STOP_FAIL			(1004)
#define HB_VIN_SENSOR_LIB_DEINIT_FAIL		(1005)
#define HB_VIN_SENSOR_LIB_AE_INIT_FAIL		(1006)
#define HB_VIN_SENSOR_LIB_CTRL_FAIL			(1007)
#define HB_VIN_SENSOR_IOCTL_LOCK_FAIL		(1008)
#define HB_VIN_SENSOR_IOCTL_UNLOCK_FAIL		(1009)
#define HB_VIN_SENSOR_IOCTL_CNT_FAIL		(1010)
#define HB_VIN_SENSOR_IOCTL_AE_FAIL			(1011)

#ifdef JSON_FILE_CAMERA_PARAMETER_CHECK
#define HB_VIO_J5DEV_INVALID_CONFIG			(1012)
#endif

#define HB_VIN_LPWM_NODE_OPEN_FAIL			(1100)
#define HB_VIN_LPWM_PARAM_FAIL				(1101)
#define HB_VIN_LPWM_INIT_FAIL				(1102)
#define HB_VIN_LPWM_CONFIG_FAIL				(1103)
#define HB_VIN_LPWM_CONFIG_OFFSET_FAIL		(1104)
#define HB_VIN_LPWM_ENABLE_SINGLE_FAIL		(1105)
#define HB_VIN_LPWM_DISABLE_SINGLE_FAIL		(1106)
#define HB_VIN_LPWM_ENABLE_ALL_FAIL			(1107)
#define HB_VIN_LPWM_DISABLE_ALL_FAIL		(1108)
#define HB_VIN_LPWM_SET_MODE_FAIL			(1109)

#define HB_VIN_MIPI_HOST_START_FAIL		(2000)
#define HB_VIN_MIPI_HOST_STOP_FAIL		(2001)
#define HB_VIN_MIPI_HOST_INIT_FAIL		(2002)
#define HB_VIN_MIPI_HOST_PARSER_FAIL	(2003)
#define HB_VIN_MIPI_HOST_NOT_ENABLE		(2004)
#define HB_VIN_MIPI_HOST_SNRCLK_SET_EN_FAIL   	(2005)
#define HB_VIN_MIPI_HOST_SNRCLK_SET_FREQ_FAIL 	(2006)
#define HB_VIN_MIPI_HOST_PPE_INIT_REQUEST_FAIL  (2007)
#define HB_VIN_MIPI_HOST_PRE_START_REQUEST_FAIL (2008)
#define HB_VIN_MIPI_HOST_PRE_INIT_RESULT_FAIL   (2009)
#define HB_VIN_MIPI_HOST_PRE_START_RESULT_FAIL  (2010)
#define HB_VIN_MIPI_HOST_IPI_RESET_FAIL		(2011)
#define HB_VIN_MIPI_HOST_IPI_FATAL_FAIL		(2012)
#define HB_VIN_MIPI_HOST_IPI_GET_INFO_FAIL	(2013)
#define HB_VIN_MIPI_HOST_IPI_SET_INFO_FAIL	(2014)
#define HB_VIN_MIPI_HOST_PPE_UNSUPPORT_FAIL (2015)

#define HB_VIN_MIPI_DEV_START_FAIL		(3000)
#define HB_VIN_MIPI_DEV_STOP_FAIL		(3001)
#define HB_VIN_MIPI_DEV_INIT_FAIL		(3002)
#define HB_VIN_MIPI_DEV_PARSER_FAIL		(3003)
#define HB_VIN_MIPI_DEV_NOT_ENABLE		(3004)
#define HB_VIN_MIPI_DEV_IPI_FATAL_FAIL		(3005)
#define HB_VIN_MIPI_DEV_IPI_GET_INFO_FAIL	(3006)
#define HB_VIN_MIPI_DEV_IPI_SET_INFO_FAIL	(3007)

/* CIM ERR INFO */
#define HB_VIN_CIM_OPEN_DEV_FAIL       (4000)
#define HB_VIN_CIM_INIT_FAIL           (4001)
#define HB_VIN_CIM_DEINIT_FAIL         (4002)
#define HB_VIN_CIM_BYPASS_FAIL         (4003)
#define HB_VIN_CIM_STOP_FAIL           (4004)
#define HB_VIN_CIM_START_FAIL          (4005)
#define HB_VIN_CIM_PARSER_FAIL         (4006)
#define HB_VIN_CIM_EPOLL_CREATE_FAIL   (4007)
#define HB_VIN_CIM_EPOLL_CTL_FAIL      (4008)
#define HB_VIN_CIM_EPOLL_WAIT_FAIL     (4009)
#define HB_VIN_CIM_STOP_WORKING        (4010)
#define HB_VIN_CIM_BAD_VALUE           (4011)
#define HB_VIN_CIM_TIME_OUT            (4012)
#define HB_VIN_CIM_INVALID_OPERATION   (4013)
#define HB_VIN_CIM_INVALID_CONFIG      (4014)
#define HB_VIN_CIM_NULL_POINT          (4015)
#define HB_VIN_CIM_BUF_MGR_FAIL        (4016)
#define HB_VIN_CIM_BIND_GROUP_FAIL     (4017)
#define HB_VIN_CIM_EOF_FAIL            (4018)
#define HB_VIN_CIM_RESET_FAIL          (4019)
#define HB_VIN_CIM_REQBUF_FAIL         (4020)
#define HB_VIN_CIM_MMAP_FAIL           (4021)
#define HB_VIN_CIM_DYNAMIC_FPS_FAIL    (4022)
#define HB_VIN_CIM_EMB_NOT_WORKING     (4023)

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __HB_CAMERA_ERROR_H__ */
